package com.addr.services;

import com.addr.dao.AddrDao;
import com.addr.entity.Addr;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
@Service
@Scope("prototype")
public class AddrServicesImpl implements AddrServices {
    @Autowired
    private AddrDao addrDao = null;
    @Transactional
    public boolean add(Addr addr) {
        boolean flag = addrDao.add(addr);
        return flag;
    }
    @Transactional
    public boolean delete(Addr addr) {
        boolean flag =addrDao.delete(addr);
        return false;
    }
    @Transactional
    public boolean update(Addr addr) {
        boolean flag = addrDao.update(addr);
        return false;
    }
    @Transactional
    public Addr selectOne(Addr addr) {
        Addr addr1 = addrDao.selectOne(addr);
        return addr1;
    }
    @Transactional
    public List<Addr> select(Addr addr) {
        List<Addr> addrList = addrDao.select(addr);
        return addrList;
    }
}
